/**
 * Copyright (c) 2020 kedacom
 * OpenATC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 * http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 **/
<template>
  <div class="left-list">
    <div class="schadule-config-container" v-if="isSchaduleShow">
      <schedule-config :route="schaduleRoute"
                       @onCloseClick="onSchaduleCloseClick"
                       @onSaveClick="onSchaduleSaveClick"/>
    </div>
    <el-card class="box-card" shadow="never">
      <el-form :rules="rules" :model="configData" class="demo-ruleForm">
        <el-form-item>
          <!-- v-if="showService" -->
          <div ref="titleBack" class="funcs">
            <div>
              <el-button @click="backClick" icon="iconfont icon-fanhui" type="text" class="title">{{ $t('openatc.main.back') }}</el-button>
            </div>
            <div>
              <el-button type="text" icon="iconfont icon-tiaodupeizhi" style="font-size: 14PX;" @click="onSchaduleClick">{{ $t('openatc.groupcontrol.schaduleConfig') }}</el-button>
              <el-button type="text" icon="el-icon-plus" @click="handleAdd">
                {{ $t('openatc.common.addroad') }}
              </el-button>
            </div>
          </div>
        </el-form-item>
        <el-form-item :label="$t('openatc.groupcontrol.name')" prop="name">
          <el-input v-model="configData.name" style="width: 88%"> </el-input>
        </el-form-item>
        <div class="tiops">
          <el-button
            type="text"
            :style="{ color: bgcolor }"
            v-if="isOpen == true"
            icon="el-icon-circle-plus-outline"
            @click="openAllRows"
            >{{ $t('openatc.button.expandall') }}</el-button
          >
          <el-button
            type="text"
            v-else
            :style="{ color: bgcolor }"
            icon="el-icon-remove-outline"
            @click="openAllRows"
            >{{ $t('openatc.button.collapseall') }}</el-button
          >
          {{ $t('openatc.groupcontrol.move') }}
        </div>
      </el-form>
      <TimeLineGroup
        @closeIcon="closeIcon"
        @delete="deleteId"
        @openIcon="openIcon"
        :route="route"
        :isOpen="isOpen"
      ></TimeLineGroup>
      <!-- <div class="edit-text">
          <i class="iconfont icon-mingchengqianbiao"></i
          >{{ $t('openatc.greenwaveoptimize.routename') }}
        </div>
        <div class="name-input">
          <el-input v-model="configData.name" style="width: 30%"> </el-input>
        </div> -->
      <!-- <div class="edit-text">
          <i class="iconfont icon-mingchengqianbiao"></i
          >{{ $t('openatc.dutyroute.routeConfig') }}
        </div>
        <div style="display: flex; flex-direction: row; justify-content: flex-end">
          <el-button class="addbtn" type="primary" @click="handleAdd">{{
            $t('openatc.greenwaveoptimize.adddevice')
          }}</el-button>
        </div> -->
      <div class="btnGroup">
        <el-button class="btn" @click="handleClose">{{
          $t('openatc.button.Cancel')
        }}</el-button>
        <el-button class="btn" type="primary" @click="onOk">{{
          $t('openatc.button.OK')
        }}</el-button>
      </div>
    </el-card>
    <el-card v-show="showCard" class="tree-card" shadow="never">
      <div class="title-top">
        <div class="title">{{ $t('openatc.common.atc') }}</div>
        <!-- 删除字体图标 -->
        <el-button
          type="text"
          class="close"
          icon="el-icon-close"
          @click="handleDelete"
        ></el-button>
        <div class="common-single-search-input">
        <el-input
          v-model="devsfilter"
          :placeholder="$t('openatc.common.searchplaceholder')"
          style="margin: 10px 0"
        >
          <el-button
            slot="append"
            @click="getSerch"
            icon="el-icon-search"
          ></el-button>
        </el-input>
      </div>
      </div>
      <div class="tree-list">
        <ORGIntersectionTree
          @checkedNodes="getCheck"
          @treeData="getTree"
          @finishLoadTree="finishLoadTree"
          :isOpenCheckbox="true"
          ref="ORGIntersectionTree"
        ></ORGIntersectionTree>
      </div>
    </el-card>
    <el-card v-if="showConfig && !showCard" class="control-lists" shadow="never">
      <div class="header">
        <!-- <div class="title">
          <span>{{ roadname }}</span>
        </div> -->
        <div class="title">
          <!-- {{curDevice ? curDevice.name : ''}} -->
          <el-tooltip v-if="this.roadname && this.roadname && this.roadname.length > 24" placement="bottom-start" effect="dark">
            <div slot="content">{{this.roadname}}</div>
            <span class="name">{{this.roadname.substr(0, 24) + '...'}}</span>
          </el-tooltip>
          <span v-else>{{this.roadname ? this.roadname : ''}}</span>
        </div>
        <div class="close" @click="handleDeleteScheme"><i class="el-icon-close"></i></div>
      </div>
      <!-- <el-button
        type="text"
        class="schemeclose"
        icon="el-icon-close"
        @click="handleDeleteScheme"
      ></el-button> -->
      <scheme-config
        ref="rightpanel"
        :key="config"
        :agentId="agentid"
        :statusData="patternStatus"
        :phaseList="phaseList"
        :realtimeStatusModalvisible="false"
        :isShowBack="false"
        :isShowRecovery="false"
        :isShowImplement="false"
        @patternCommitCallback="patternCommitCallback"
        @closePhaseBack="closePhaseBack"
      />
    </el-card>
  </div>
</template>

<script>
import Messagebox from '../../../components/MessageBox/index'
import DevicePanel from '../tables/device'
import { getTheme } from '../../../utils/auth'
import { getTscControl } from '../../../api/control'
import { getTscPhase } from '../../../api/route'// getPatternList
import TimeLineGroup from './timeLineGroup'
import ORGIntersectionTree from '../../../components/ORGIntersectionTree/index'
import { getMessageByCode } from '../../../utils/responseMessage'
import ChoseIntersection from '../../../components/ChoseIntersection'
import ScheduleConfig from '../../../components/ScheduleConfig'
import {
  UpdateViproute
} from '../../../api/service'
// import ServiceUtil from './serviceUtil.js'
export default {
  name: 'schemeConfiguration',
  components: {
    ScheduleConfig,
    Messagebox,
    ORGIntersectionTree,
    TimeLineGroup,
    DevicePanel,
    ChoseIntersection
  },
  props: {
    chooseId: {
      type: Number
    },
    editRoute: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  data () {
    return {
      schaduleRoute: {},
      isSchaduleShow: false,
      routeData: {},
      bgcolor: getTheme() === 'light' ? '#303133' : '#ffffff',
      config: false,
      patternStatus: {},
      isOpen: false,
      roadname: '',
      // isClose: true,
      checkData: [],
      // lineChange: false,
      lockPhaseBtnName: this.$t('openatccomponents.overview.comfirm'),
      showCard: false,
      showConfig: false,
      route: {},
      // lineData: {},
      agentid: '0',
      devsfilter: '',
      rules: {
        name: [
          {
            required: true,
            message: this.$t('openatc.groupcontrol.routenamenull'),
            trigger: 'blur'
          }
        ]
      },
      // configurationVisible: false, // 配置界面是否显示
      activeTab: 'pattern',
      phaseList: [], // 相位列表
      messageboxVisible: false, // 关闭界面二期确认弹窗是否显示
      configData: {}, // 内部可修改的配置数据
      chooseData: [],
      finalLists: [],
      deviceIds: [], // 初始协调线路包含的设备id
      devicesData: [], // 设备面板数据
      patternData: [], // 方案面板数据
      defaultScheme: { // 默认协调方案配置参数
        sortid: 0,
        patternid: 0,
        patterndes: ''
      },
      options: [
        {
          value: -1,
          label: this.$t('openatc.dutyroute.unknowControl')
        },
        {
          value: 0,
          label: this.$t('openatccomponents.overview.modelList0')
        },
        {
          value: 1,
          label: this.$t('openatccomponents.overview.modelList1')
        },
        {
          value: 2,
          label: this.$t('openatccomponents.overview.modelList2')
        },
        {
          value: 3,
          label: this.$t('openatccomponents.overview.modelList3')
        },
        {
          value: 4,
          label: this.$t('openatccomponents.overview.modelList4')
        },
        {
          value: 5,
          label: this.$t('openatccomponents.overview.modelList5')
        },
        {
          value: 6,
          label: this.$t('openatccomponents.overview.modelList6')
        },
        {
          value: 7,
          label: this.$t('openatccomponents.overview.modelList7')
        },
        {
          value: 8,
          label: this.$t('openatccomponents.overview.modelList8')
        },
        {
          value: 9,
          label: this.$t('openatccomponents.overview.modelList9')
        },
        {
          value: 10,
          label: this.$t('openatccomponents.overview.modelList10')
        },
        {
          value: 11,
          label: this.$t('openatccomponents.overview.modelList11')
        },
        {
          value: 12,
          label: this.$t('openatccomponents.overview.modelList12')
        },
        {
          value: 13,
          label: this.$t('openatccomponents.overview.modelList13')
        },
        {
          value: 14,
          label: this.$t('openatccomponents.overview.modelList14')
        },
        {
          value: 15,
          label: this.$t('openatccomponents.overview.modelList15')
        },
        {
          value: 16,
          label: this.$t('openatccomponents.overview.modelList16')
        },
        {
          value: 17,
          label: this.$t('openatccomponents.overview.modelList17')
        },
        {
          value: 18,
          label: this.$t('openatccomponents.overview.modelList18')
        },
        {
          value: 19,
          label: this.$t('openatccomponents.overview.modelList19')
        },
        {
          value: 21,
          label: this.$t('openatccomponents.overview.modelList21')
        },
        {
          value: 22,
          label: this.$t('openatccomponents.overview.modelList22')
        },
        {
          value: 23,
          label: this.$t('openatccomponents.overview.modelList23')
        },
        {
          value: 24,
          label: this.$t('openatccomponents.overview.modelList24')
        },
        {
          value: 99,
          label: this.$t('openatccomponents.overview.modelList99')
        },
        {
          value: 100,
          label: this.$t('openatccomponents.overview.modelList100')
        }
      ]
    }
  },
  watch: {
    chooseId: {
      handler: function (val) {
        if (val) {
          this.showCard = false
        }
      },
      immediate: true
    },
    showCard: {
      handler: function (val) {
        if (val) {
          this.isSchaduleShow = false
        }
      },
      immediate: true
    },
    showConfig: {
      handler: function (val) {
        if (val) {
          this.isSchaduleShow = false
        }
      },
      immediate: true
    },
    route: {
      handler: function (val) {
        this.configData = JSON.parse(JSON.stringify(val))
        this.route = val
        this.$emit('onRouteChange', this.route)
        this.finalLists = val.devs
      },
      deep: true
    },
    routeData: {
      handler: function (val) {
        this.devicesData = []
        this.patternData = []
        this.configData = JSON.parse(JSON.stringify(val))
      },
      deep: true
    }
  },
  mounted () {
    if (this.editRoute && this.editRoute.devs && this.editRoute.devs.length > 0) {
      this.route = this.editRoute
      for (let item of this.route.devs) {
        item.currentControlName = this.getNameById(item.currentControl)
        let controlName = this.getNameById(item.data.control)
        item.controlName = controlName
        if (item.data.terminal > 0) {
          item.terminalname = this.$t('openatc.greenwaveoptimize.pattern') + item.data.terminal
        }
      }
    }
    this.$refs.ORGIntersectionTree.getDeviceRanges(this.devsfilter).then(res => {
      this.checkData = res.filter(item => {
        if (this.chooseId && this.chooseId !== 0) {
          return this.editRoute.devs.some(ele => ele.agentid === item.agentid)
        }
      })
    })
  },
  created () {
  },
  methods: {
    openAllRows () {
      this.isOpen = !this.isOpen
    },
    backClick () {
      this.$emit('backClick')
    },
    closePhaseBack () {
      this.$emit('closeAddDrawer')
    },
    handleDeleteScheme () {
      this.showConfig = false
    },
    patternCommitCallback (pattern) {
      this.route.devs.forEach(item => {
        if (item.agentid === this.agentid) {
          pattern.duration = (pattern.data && pattern.data.duration) ? pattern.data.duration : pattern.duration
          if (pattern.control === 22) { // 相位锁定
            this.$set(item, 'data', pattern)
            this.$set(item, 'value', pattern.data.value)
            this.$set(item, 'duration', pattern.data.duration)
            this.$set(item, 'control', pattern.control)
          } else if (pattern.control === 23) { // 相位关断
            this.$set(item, 'data', pattern)
            this.$set(item, 'value', pattern.value)
            this.$set(item, 'duration', pattern.duration)
            this.$set(item, 'control', pattern.control)
          } else if (pattern.control === 24) {
            this.$set(item, 'data', pattern)
            this.$set(item, 'value', pattern.value)
            this.$set(item, 'duration', pattern.duration)
            this.$set(item, 'control', pattern.control)
          } else if (pattern.control === 100) {
            this.$set(item, 'data', pattern)
            this.$set(item, 'value', pattern.value)
            this.$set(item, 'duration', pattern.duration)
            this.$set(item, 'control', pattern.control)
          } else {
            this.$set(item, 'data', pattern)
            this.$set(item, 'terminal', pattern.terminal)
            this.$set(item, 'value', pattern.value)
            this.$set(item, 'duration', pattern.duration)
            this.$set(item, 'control', pattern.control)
          }
          let controlName = this.getNameById(pattern.control)
          item.controlName = controlName
          if (pattern.terminal && pattern.terminal > 0) {
            item.terminalname = this.$t('openatc.greenwaveoptimize.pattern') + pattern.terminal
          } else {
            item.terminalname = ''
          }
          // if (!this.chooseId || this.chooseId === 0) {
          this.chooseData.push(item)
          // }
        }
      })
      this.showConfig = false
      this.showCard = true
    },
    getNameById (id) {
      let res = ''
      for (const item of this.options) {
        if (id === item.value) {
          res = item.label
          break
        }
      }
      return res
    },
    async handleConfig (id) {
      await this.getCurPhase(id)
      await this.getCurrentPatternStatus(id)
    },
    finishLoadTree () {
      this.$refs.ORGIntersectionTree.setCheckedIntersection(this.checkData)
    },
    getCurPhase (agentid, key) {
      // 获取当前上行/下行相位选项
      this.loading = true
      return new Promise((resolve, reject) => {
        getTscPhase(agentid).then(res => {
          this.loading = false
          if (!res.data.success) {
            let msg = getMessageByCode(res.data.code, this.$i18n.locale)
            if (res.data.data) {
              let errorCode = res.data.data.errorCode
              if (errorCode) {
                msg = msg + ' - ' + getMessageByCode(errorCode, this.$i18n.locale)
              }
            }
            this.$message.error(msg)
            return
          }
          this.phaseList = res.data.data.data.phaseList
          resolve(this.phaseList)
        })
      })
    },
    async getCurrentPatternStatus (iframdevid) {
      await getTscControl(iframdevid).then((data) => {
        if (!data.data.success) {
          if (data.data.code === '4003') {
            this.$message.error(getMessageByCode(data.data.code, this.$i18n.locale))
            return
          }
          let parrenterror = getMessageByCode(data.data.code, this.$i18n.locale)
          if (data.data.data) {
            // 子类型错误
            let childErrorCode = data.data.data.errorCode
            if (childErrorCode) {
              let childerror = getMessageByCode(data.data.data.errorCode, this.$i18n.locale)
              this.$message.error(parrenterror + ',' + childerror)
            }
          } else {
            this.$message.error(parrenterror)
          }
          return
        }
        this.patternStatus = JSON.parse(JSON.stringify(data.data.data.data))
      }).catch(error => {
        console.log(error)
      })
    },
    closeIcon (val) {
      this.config = !this.config
      this.agentid = val.agentid
      this.roadname = val.name
      // 获取控制面板方案编号
      this.handleConfig(this.agentid)
    },
    openIcon (val) {
      // if (val) {
      this.showCard = false
      this.showConfig = true
      // } else {
      //   this.showCard = true
      //   this.showConfig = false
      // }
    },
    deleteId (val) {
      this.checkData.map((item, index) => {
        if (item.agentid === val) {
          this.checkData.splice(index, 1)
        }
      })
      if (this.chooseId && this.chooseId !== 0) {
        this.editRoute.devs.filter(item => item.agentid !== val)
      }
      this.$refs.ORGIntersectionTree.setCheckedIntersection(this.checkData)
    },
    handleClose () {
      this.$emit('research')
    },
    getSerch () {
      this.$refs.ORGIntersectionTree.getDeviceRanges(this.devsfilter)
    },
    reset () {
      this.activeTab = 'pattern'
    },
    checkRouteName (reqData) {
      let res = true
      let name = reqData.name
      if (!name || name.trim() === '') {
        this.$message.error(this.$t('openatc.dutyroute.emptyRouteName'))
        res = false
        return res
      }
      for (let item of reqData.devs) {
        if (name === item.name) {
          this.$message.error(this.$t('openatc.dutyroute.namerepeat'))
          res = false
          return res
        }
      }
      return res
    },
    checkRules (reqData) {
      if (!this.checkRouteName(reqData)) {
        return false
      }
      let devs = reqData.devs
      for (let inter of devs) {
        if (!inter.data) {
          let msg = this.$t('openatc.devicemanager.devicename') + ': ' + inter.name + ', ' + this.$t('openatc.dutyroute.configpattern')
          this.$message.error(msg)
          return false
        }
        if (!inter.data.duration || inter.data.duration < 10) {
          let msg = this.$t('openatc.devicemanager.devicename') + ': ' + inter.name + ', ' + this.$t('openatc.dutyroute.lasttimeMustBeGraterThanTen')
          this.$message.error(msg)
          return false
        }
      }
      return true
    },
    onOk () {
      // let reqData = this.getReqData()
      this.route.devs.forEach(item => {
        delete item.state
      })
      let reqData = {
        // 'id': this.configData.id,
        'type': 1,
        'name': this.configData.name,
        'devs': this.route.devs,
        'schedule': this.route.schedule,
        'month': this.route.month,
        'day': this.route.day,
        'date': this.route.date,
        'starttime': this.route.starttime,
        'endtime': this.route.endtime
      }
      if (this.chooseId && this.chooseId !== 0) {
        reqData.id = this.configData.id
      }
      if (!this.checkRules(reqData)) { // 检验方案和相位是否为空
        return
      }
      UpdateViproute(reqData).then(res => {
        if (!res.data.success) {
          this.$message.error(getMessageByCode(res.data.code, this.$i18n.locale))
          return
        }
        this.route = res.data.data
        this.$message({
          message: this.$t('openatc.common.operationsuccess'),
          type: 'success',
          duration: 1500
        })
        this.reset()
        this.route.devs = this.route.devs
        this.$emit('research', this.route)
      })
    },
    getTree (data) {
      if (data.length > 0 && !this.chooseId) {
        this.showCard = true
      }
    },
    onSchaduleClick () {
      this.isSchaduleShow = true
      this.showCard = false
      this.showConfig = false
      this.$nextTick(() => {
        this.schaduleRoute = {...this.route}
      })
    },
    onSchaduleCloseClick () {
      this.isSchaduleShow = false
    },
    onSchaduleSaveClick (item) {
      this.route = {...this.route, ...item}
      this.isSchaduleShow = false
    },
    showTreeCard (data) {
      this.$refs.ORGIntersectionTree.setCheckedIntersection(data)
      this.getCheck(data)
    },
    handleAdd () {
      this.showCard = true
      this.$refs.ORGIntersectionTree.setCheckedIntersection(this.checkData)
    },
    cancle () {
      this.messageboxVisible = false
    },
    handleDelete () {
      this.showCard = false
    },
    onEditClick (route) {
      this.routeData = route
    },
    getCheck (list) {
      this.checkData = list
      let res = {
        // 'id': this.configData.id,
        'name': this.configData.name,
        'devs': []
      }
      if (this.chooseId && this.chooseId !== 0) {
        res.id = this.configData.id
      }
      let devs = []
      for (let dev of list) {
        let item = {
          'id': dev.id,
          'viprouteid': this.configData.id,
          'agentid': dev.agentid,
          'name': dev.name,
          'geometry': {
            'type': 'Point',
            'coordinates': [
              0,
              0
            ]
          },
          'location': [
            0,
            0
          ],
          'control': dev.control,
          'terminal': dev.patternid,
          'terminalname': dev.patterndesc,
          // 'value': dev.state,
          'duration': dev.duration
        }
        item.data = dev.data
        let geometry = dev.geometry
        let location = dev.location
        if (geometry && geometry.coordinates && geometry.coordinates.length > 0) {
          item.geometry = geometry
        }
        if (location && location.length > 0) {
          item.location = location
        }
        devs.push(item)
      }
      res.devs = devs
      if (this.chooseId && this.chooseId !== 0) {
        let newItems = []
        list.forEach(checkDataItem => {
          const editRouteDevItem = (this.finalLists.length > 0 ? this.finalLists : this.editRoute.devs).find(editRouteDevItem => {
            return editRouteDevItem.agentid === checkDataItem.agentid
          })
          if (!editRouteDevItem) {
            newItems.push(checkDataItem)
          }
        })
        let filteredDevs = (this.finalLists.length > 0 ? this.finalLists : this.editRoute.devs).filter(editRouteDevItem => {
          return list.some(checkDataItem => {
            return editRouteDevItem.agentid === checkDataItem.agentid
          })
        })
        let order = (this.finalLists.length > 0 ? this.finalLists : this.editRoute.devs).map(item => item.agentid)
        filteredDevs.sort((a, b) => {
          return order.indexOf(a.agentid) - order.indexOf(b.agentid)
        })
        let finalList = [...filteredDevs, ...newItems]
        res.devs = finalList
        this.finalLists = []
      } else {
        // 单次点击树添加
        if (this.chooseData && this.chooseData.length > 0) {
          for (let item of this.chooseData) {
            for (let dev of res.devs) {
              if (item.agentid === dev.agentid) {
                dev.data = item.data
                dev.terminal = item.terminal
                // dev.state = item.state
                // dev.value = item.state
                dev.duration = item.duration
                dev.controlName = item.controlName
                dev.terminalname = item.terminalname
              }
            }
          }
          let newItems = []
          list.forEach(checkDataItem => {
            const editRouteDevItem = this.route.devs.find(editRouteDevItem => {
              return editRouteDevItem.agentid === checkDataItem.agentid
            })
            if (!editRouteDevItem) {
              newItems.push(checkDataItem)
            }
          })
          let filteredDevs = this.route.devs.filter(editRouteDevItem => {
            return list.some(checkDataItem => {
              return editRouteDevItem.agentid === checkDataItem.agentid
            })
          })
          let order = this.route.devs.map(item => item.agentid)
          filteredDevs.sort((a, b) => {
            return order.indexOf(a.agentid) - order.indexOf(b.agentid)
          })
          let finalList = [...filteredDevs, ...newItems]
          res.devs = finalList
        } else {
          if (this.route.devs) {
            if (this.route.devs.length > list.length) {
              let devs = this.route.devs.filter(item => {
                return list.some(ele => ele.agentid === item.agentid)
              })
              res.devs = devs
            }
          } else {
            res.devs = devs
          }
        }
      }
      this.route = res
    }
  }
}
</script>

<style lang="scss" rel="stylesheet/scss" scoped>
.left-list {
  .el-card /deep/ .el-card__body {
    /* .scheme-config .closephase-control .closephasekanban {
      width: 100%;
    } */
    /* .scheme-config .manual-control-modal, .priority-control {
      padding: unset;
    }
    .scheme-config .manual-control-modal {
      height: 100%;
    }
    .scheme-config .manual-control-modal .title {
      font-size: 18PX;
      font-weight: bold;
    } */
    /* .scheme-config .lockingphase-control .el-form--inline .el-form-item__label {
      width: 74PX !important;
    }
    .scheme-config .lockingphase-control .el-form-item {
      width: 42% !important;
    }
    .scheme-config .lockingphase-control .closephasekanban {
      width: 100%;
      margin: unset;
    }
    .scheme-config .lockingphase-control .footer {
      margin-right: 80PX;
    }
    .scheme-config .tentativeplan-control .footer {
      margin-right: 0;
    } */
    /* .scheme-config .tentativeplan-control .el-form-item__content {
      margin-left: 75PX !important;
    }
    .scheme-config .tentativeplan-control .el-form-item__label {
      width: 75PX !important;
    }
    .scheme-config .priority-control .footer {
      margin-right: 10PX;
    }
    .scheme-config .tentativeplan-control {
      height: 100%;
      padding: unset;
      min-width: unset;
      // width: 95%;
      overflow-y: auto !important;
    }
    .scheme-config .tentativeplan-control .expendkanban .common-board-column, .tentativeplan-control .closephasekanban {
      width: 100%;
    } */
    // .scheme-config .dev-fault-detail {
    //   height: unset;
    // }
    padding-top: unset;
    height: 100% !important;
  }
  .control-lists {
    width: 380PX;
    height: calc(100% - 90PX);
    position: absolute;
    left: 470PX;
    top: 10PX;
    border-radius: 2PX;
    box-shadow: 0PX 0PX 8PX 1PX rgba(0, 32, 60, 0.3);
    /deep/ .el-card__body {
      padding: 0 0 20PX 0;
    }
    .schemeclose {
      position: absolute;
      font-size: 24PX;
      width: 30PX;
      height: 30PX;
      padding: unset;
      color: #909399;
      right: 10PX;
      top: 10PX;
      z-index: 999;
    }
  }
}
</style>
